<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: RubyMotionQuery::Font
  
    &mdash; Documentation by YARD 0.8.7.3
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (F)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../RubyMotionQuery.html" title="RubyMotionQuery (module)">RubyMotionQuery</a></span></span>
     &raquo; 
    <span class="title">Font</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Class: RubyMotionQuery::Font
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">RubyMotionQuery::Font</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">motion/ruby_motion_query/font.rb</dd>
  
</dl>
<div class="clear"></div>








  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#add_named-class_method" title="add_named (class method)">+ (Object) <strong>add_named</strong>(key, font_name_or_font, size = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#family_list-class_method" title="family_list (class method)">+ (Array) <strong>family_list</strong> </a>
    

    
      (also: family_names)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Use this in the console to get a list of font families.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#font_with_name-class_method" title="font_with_name (class method)">+ (UIFont) <strong>font_with_name</strong>(name, size) </a>
    

    
      (also: with_name)
    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#for_family-class_method" title="for_family (class method)">+ (Array) <strong>for_family</strong>(family) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#system-class_method" title="system (class method)">+ (UIFont) <strong>system</strong>(size = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>System font given size.</p>
</div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="add_named-class_method">
  
    + (<tt><span class='object_link'><a href="../Object.html" title="Object (class)">Object</a></span></tt>) <strong>add_named</strong>(key, font_name_or_font, size = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='comment'># One way to add your own fonts it to open up the Font class and add your own
</span><span class='const'>STANDARD_FONT</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Helvetica Neue</span><span class='tstring_end'>'</span></span>
<span class='kw'>def</span> <span class='id identifier rubyid_standard_at_size'>standard_at_size</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span><span class='semicolon'>;</span>
  <span class='const'>UIFont</span><span class='period'>.</span><span class='id identifier rubyid_fontWithName'>fontWithName</span><span class='lparen'>(</span><span class='const'>STANDARD_NAME</span><span class='comma'>,</span> <span class='label'>size:</span> <span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
<span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_standard_large'>standard_large</span> <span class='semicolon'>;</span> <span class='ivar'>@standard_large</span> <span class='op'>||=</span> <span class='id identifier rubyid_standard_at_size'>standard_at_size</span><span class='lparen'>(</span><span class='int'>18</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span>
<span class='kw'>def</span> <span class='id identifier rubyid_standard_medium'>standard_medium</span> <span class='semicolon'>;</span> <span class='ivar'>@standard_medium</span> <span class='op'>||=</span> <span class='id identifier rubyid_standard_at_size'>standard_at_size</span><span class='lparen'>(</span><span class='int'>12</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span>

<span class='comment'># Another way is to add named fonts:
</span><span class='const'>RubyMotionQuery</span><span class='op'>::</span><span class='const'>Font</span><span class='period'>.</span><span class='id identifier rubyid_add_named_font'>add_named_font</span> <span class='symbol'>:large</span><span class='comma'>,</span>  <span class='const'>STANDARD_FONT</span><span class='comma'>,</span> <span class='int'>44</span>

<span class='comment'># In a stylesheet you can just do
</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_add_named_font'>add_named_font</span> <span class='symbol'>:large</span><span class='comma'>,</span>  <span class='const'>STANDARD_FONT</span><span class='comma'>,</span> <span class='int'>44</span>

<span class='comment'># The use like so in your stylesheet:
</span><span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_large'>large</span>

<span class='comment'># The use like so anywhere else:
</span><span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_large'>large</span></code></pre>
    
  </div>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


38
39
40
41
42
43
44
45
46
47
48</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 38</span>

<span class='kw'>def</span> <span class='id identifier rubyid_add_named'>add_named</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_font_name_or_font'>font_name_or_font</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_font_name_or_font'>font_name_or_font</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>UIFont</span><span class='rparen'>)</span>
    <span class='id identifier rubyid_font_name_or_font'>font_name_or_font</span>
  <span class='kw'>else</span>
    <span class='const'>Font</span><span class='period'>.</span><span class='id identifier rubyid_font_with_name'>font_with_name</span><span class='lparen'>(</span><span class='id identifier rubyid_font_name_or_font'>font_name_or_font</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span> <span class='op'>||</span> <span class='int'>22</span><span class='rparen'>)</span>
  <span class='kw'>end</span>

  <span class='const'>Font</span><span class='period'>.</span><span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span> <span class='kw'>do</span>
    <span class='id identifier rubyid_font'>font</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="family_list-class_method">
  
    + (<tt>Array</tt>) <strong>family_list</strong> 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='family_names-class_method'>family_names</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Use this in the console to get a list of font families</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 64</span>

<span class='kw'>def</span> <span class='id identifier rubyid_family_list'>family_list</span>
  <span class='const'>UIFont</span><span class='period'>.</span><span class='id identifier rubyid_familyNames'>familyNames</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="font_with_name-class_method">
  
    + (<tt>UIFont</tt>) <strong>font_with_name</strong>(name, size) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='with_name-class_method'>with_name</span></span>
    </span>
  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_font_with_name'>font_with_name</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Helvetica Neue</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='int'>18</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>name</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Name of font</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>size</span>
      
      
        <span class='type'>(<tt>Float</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>Size of font</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIFont</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


56
57
58
59</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 56</span>

<span class='kw'>def</span> <span class='id identifier rubyid_font_with_name'>font_with_name</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
  <span class='comment'># TODO, should rename this to just with_name, so it's rmq.font.with_name
</span>  <span class='const'>UIFont</span><span class='period'>.</span><span class='id identifier rubyid_fontWithName'>fontWithName</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>size:</span> <span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="for_family-class_method">
  
    + (<tt>Array</tt>) <strong>for_family</strong>(family) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


70
71
72</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 70</span>

<span class='kw'>def</span> <span class='id identifier rubyid_for_family'>for_family</span><span class='lparen'>(</span><span class='id identifier rubyid_family'>family</span><span class='rparen'>)</span>
  <span class='const'>UIFont</span><span class='period'>.</span><span class='id identifier rubyid_fontNamesForFamilyName'>fontNamesForFamilyName</span><span class='lparen'>(</span><span class='id identifier rubyid_family'>family</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="system-class_method">
  
    + (<tt>UIFont</tt>) <strong>system</strong>(size = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns System font given size</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='id identifier rubyid_font'>font</span> <span class='op'>=</span> <span class='id identifier rubyid_rmq'>rmq</span><span class='period'>.</span><span class='id identifier rubyid_font'>font</span><span class='period'>.</span><span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span><span class='int'>18</span><span class='rparen'>)</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>size</span>
      
      
        <span class='type'>(<tt>Float</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>nil</tt>)</em>
      
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>UIFont</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'>
<p>System font given size</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


79
80
81</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'motion/ruby_motion_query/font.rb', line 79</span>

<span class='kw'>def</span> <span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='const'>UIFont</span><span class='period'>.</span><span class='id identifier rubyid_systemFontOfSize'>systemFontOfSize</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sun Dec  8 20:15:51 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.7.3 (ruby-1.9.3).
</div>

  </body>
</html>